package com.craftsman.tomcat.nio;

/**
 * 抽象tomcat servlet
 * @author chenfanglin
 * @date 2021年05月16日
 */
public abstract class BXNIOServlet {



    public void service(BXNIORequest request, BXNIOResponse response)throws Exception{
        if("GET".equalsIgnoreCase(request.getRequest().method().name())){
            doGet(request,response);
        }else if("POST".equalsIgnoreCase(request.getRequest().method().name())){
            doPost(request,response);
        }
    }

    public abstract void doGet(BXNIORequest request,BXNIOResponse response)throws Exception;

    public abstract void doPost(BXNIORequest request,BXNIOResponse response)throws Exception;


}
